Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.

Support for preview environments#418

Merged
potofpie merged 8 commits intomainfrom
preview-envs
Jul 15, 2025
Merged

Support for preview environments#418
potofpie merged 8 commits intomainfrom
preview-envs

Conversation

@potofpie
Copy link
Copy Markdown
Member

@potofpie potofpie commented Jul 15, 2025

https://screen.studio/share/ChACcSms

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features
    • Added support for signaling preview deployments when the "latest" tag is not present during cloud deployment. Deployment status updates now include a "preview" indicator.
    • Improved Mac installation process by enabling direct CLI installation via a shell script when Homebrew is unavailable.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jul 15, 2025

Walkthrough

A new boolean variable preview is introduced in the cloud deployment command logic to indicate preview deployments. The function updateDeploymentStatusCompleted is updated to accept this preview flag, and the deployment status update API payload now includes the preview field, signaling preview status based on deployment tags. Additionally, the macOS installation script is enhanced to run a curl command to install the Agentuity CLI when Homebrew is not available.

Changes

File(s) Change Summary
cmd/cloud.go Added preview boolean logic based on deployment tags; updated function signature and API payload to include preview status.
install.sh Added a curl command to install Agentuity CLI in install_mac() when Homebrew is unavailable, replacing a previous no-op.

Poem

A preview flag now hops along,
In deployment code, where it belongs.
If "latest" tag you do not see,
Preview mode it soon shall be!

And on Mac installs, a curl command,
Helps Agentuity join your land.
🐇✨🚀

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch preview-envs

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 764db42 and c23ddab.

📒 Files selected for processing (1)
  • cmd/cloud.go (4 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
cmd/cloud.go (1)
internal/util/api.go (1)
  • NewAPIClient (70-78)
🔇 Additional comments (5)
cmd/cloud.go (5)

12-12: LGTM: Import addition is appropriate.

The slices import is correctly added to support the slices.Contains function used in the preview detection logic.


203-203: LGTM: Preview variable initialization is correct.

The boolean variable is properly initialized to false, which is the expected default for non-preview deployments.


595-595: LGTM: Function call correctly updated with preview parameter.

The function call properly passes the preview boolean flag to match the updated function signature.


649-649: LGTM: Function signature updated appropriately.

The function signature is correctly updated to accept the preview boolean parameter. This is a breaking change, but appears to be an internal function, so it should be acceptable.


651-651: LGTM: Payload correctly updated to include preview field.

The payload type is properly changed from map[string]string to map[string]any to accommodate the boolean preview field, and the field is correctly included in the payload.

Comment thread cmd/cloud.go Outdated
Comment on lines +210 to +214
//cbeck if latest tag is present in the tags array
if len(tags) != 0 && !slices.Contains(tags, "latest") {
logger.Debug("latest tag not found in tags array, setting preview to true")
preview = true
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Fix typo in comment and verify preview detection logic.

The preview detection logic correctly identifies deployments without the "latest" tag as previews, but there's a typo in the comment.

Apply this diff to fix the typo:

-		//cbeck if latest tag is present in the tags array
+		//check if latest tag is present in the tags array

Let me verify this logic handles edge cases correctly:


🏁 Script executed:

#!/bin/bash
# Description: Check if there are other places where preview logic might be needed
# Expected: Find other deployment-related functions that might need preview awareness

# Search for deployment status functions
rg -A 3 -B 3 "updateDeploymentStatus"

# Search for other deployment completion logic
rg -A 3 -B 3 "deployment.*complet"

Length of output: 3082


Fix typo in preview detection comment

The preview detection logic correctly flags deployments without the "latest" tag as previews. Update the comment to fix a typo:

  • File: cmd/cloud.go, Lines 210–214
-		//cbeck if latest tag is present in the tags array
+		//check if latest tag is present in the tags array

No other deployment-related functions require preview-awareness adjustments.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
//cbeck if latest tag is present in the tags array
if len(tags) != 0 && !slices.Contains(tags, "latest") {
logger.Debug("latest tag not found in tags array, setting preview to true")
preview = true
}
//check if latest tag is present in the tags array
if len(tags) != 0 && !slices.Contains(tags, "latest") {
logger.Debug("latest tag not found in tags array, setting preview to true")
preview = true
}
🤖 Prompt for AI Agents
In cmd/cloud.go around lines 210 to 214, fix the typo in the comment above the
preview detection logic. Change "cbeck" to "check" so the comment correctly
reads "check if latest tag is present in the tags array" to improve clarity.

Copy link
Copy Markdown
Member

@jhaynie jhaynie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small nit

Comment thread cmd/cloud.go Outdated
Co-authored-by: Jeff Haynie <jhaynie@agentuity.com>
@potofpie potofpie requested a review from jhaynie July 15, 2025 19:39
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 69392bb and b465e64.

📒 Files selected for processing (1)
  • install.sh (1 hunks)
🧰 Additional context used
🪛 GitHub Actions: Go Build and Test
install.sh

[error] 1-1: Checksum verification failed during Agentuity CLI installation. Expected checksum does not match the downloaded file's checksum.

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (go)

Comment thread install.sh
Comment on lines 235 to 238
else
ohai "Installing Agentuity CLI using curl..."
curl -fsS https://agentuity.sh | sh
fi
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Script keeps running after the curl | sh path → double-install + checksum failure

install_mac() now pipes a remote script:

curl -fsS https://agentuity.sh | sh
  1. After this call the outer script still returns to main and proceeds with check_latest_release → download_release → …, attempting a second (tarball) install. The pipeline log shows this already breaks at checksum verification.
  2. curl ignores the $CURL variable used everywhere else – inconsistent and makes the ‑-CURL override ineffective.
  3. No error handling: if the remote script exits non-zero the install script blithely continues.
  4. Security: running an unauthenticated remote script without checksum/GPG verification is risky. At minimum, enforce TLS (-L), use the overridable binary, and abort on failure.

Suggested fix:

-  else
-      ohai "Installing Agentuity CLI using curl..."
-      curl -fsS https://agentuity.sh | sh
+  else
+      ohai "Installing Agentuity CLI using curl..."
+      # Use the overridable CURL var, abort on error, and stop this script afterwards
+      if ! "$CURL" -fsSL https://agentuity.sh | sh; then
+        abort "cURL installation failed. Please check your connection or try --no-brew again."
+      fi
+      success      # print final message & exit 0
+      return 0     # prevent double-installation logic in main()
   fi

This terminates execution after the curl-based install, aligns with the Homebrew branch behaviour, and respects the existing $CURL abstraction.

🤖 Prompt for AI Agents
In install.sh around lines 235 to 238, the script runs a remote install via curl
piped to sh but then continues executing the rest of the install script, causing
a double install and checksum failure. To fix this, replace the hardcoded curl
command with the existing $CURL variable including the -L flag for TLS
enforcement, add error handling to abort if the remote script fails, and ensure
the script exits immediately after this install step to prevent further
execution. This aligns with the Homebrew branch behavior and maintains
consistency and security.

@potofpie potofpie merged commit d282f93 into main Jul 15, 2025
11 of 14 checks passed
@potofpie potofpie deleted the preview-envs branch July 15, 2025 21:57
@devin-ai-integration devin-ai-integration Bot mentioned this pull request Jul 16, 2025
5 tasks
@coderabbitai coderabbitai Bot mentioned this pull request Jul 17, 2025
3 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants